<?php

namespace app\common\model;

use app\extra\BaseModel;

class Department extends BaseModel
{
    use \think\model\concern\SoftDelete;
    protected $deleteTime = 'delete_time';
    /**
     * 添加额外参数
     * @param $item
     */
    public function setAddedField(&$item){
        // $item['public_desc'] = \app\extra\DBCont::getPublishStatus($item['publish']);
        $item['city_name'] = model('city')->where('id', $item['city_id'])->value('name');
        $item['speciality_num'] = model('speciality')->where('department_id', $item['id'])->count();
    }
}
